
# https://www.baidu.com/s?wd=%E7%8E%8B%E8%80%85%E8%8D%A3%E8%80%80

# ASCII码

# GB2312 中国  Shift_JIS 日本

import urllib.request
import urllib.parse

inputs = "王者荣耀"
# ---------------------------------------------------------
keywords = urllib.parse.quote(inputs)
# ---------------------------------------------------------
url = "https://www.baidu.com/s?wd=%s" % keywords

headers = {
    'user-agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36'
}


request = urllib.request.Request(url=url,headers=headers)

response = urllib.request.urlopen(request)

content = response.read()

content_decode = content.decode('utf-8')

print(content_decode)


